import request from '#/utils/requestAbort.js';
import { exportRequest } from '#/utils/request.js';

// 省份-交易中心-场站（数据权限）
export async function queryMarketList(menuCode: any) {
  return request(`/power/dataPower/common/${menuCode}/t_station`, {
    method: 'GET',
  });
}

// 获取菜单组件类型列表
export async function queryStationMarketBase(params: any = {}) {
  return request(`/tianji-config/marketConfig/queryStationMarketBase`, {
    method: 'POST',
    data: params,
  });
}

// 新增和修改
export async function updateStationBaseConfigData(params: any = {}) {
  return request(`/configuration/stationTradeParamConfig/updateStationBaseConfigData`, {
    method: 'POST',
    data: params,
  });
}

// 查询
export async function queryStationBaseConfigData(params: any = {}) {
  return request(`/configuration/stationTradeParamConfig/queryStationBaseConfigData`, {
    method: 'POST',
    data: params,
  });
}

// 删除
export async function deleteStationBaseConfigData(params: any = {}) {
  return request(`/configuration/stationTradeParamConfig/deleteStationBaseConfigData`, {
    method: 'POST',
    data: params,
  });
}

// 新疆查询
export async function xjQueryList(params: any) {
  return request(`/configuration/timeFrameInfo/queryYearList`, {
    method: 'POST',
    data: params,
  });
}

// 新增新疆数据
export async function addXjList(params: any) {
  return request(`/configuration/timeFrameInfo/addYearTimeOrder`, {
    method: 'POST',
    data: params,
  });
}

// 宁夏查询
export async function nxQueryList(params: any) {
  return request(`/configuration/timeFrameInfo/queryYearList`, {
    method: 'POST',
    data: params,
  });
}

// 新增宁夏数据
export async function addNxList(params: any) {
  return request(`/configuration/timeFrameInfo/addYearTimeOrder`, {
    method: 'POST',
    data: params,
  });
}

// 新疆PDF文件导入
export async function importList(data: any) {
  return request(`/configuration/timeFrameInfo/uploadFile`, {
    method: 'POST',
    data,
  });
}

// 山西查询中长期限价
export function querySxMediumAndLongData(data: any) {
  return request(`/configuration/officialGuidancePrice/queryList`, {
    method: 'POST',
    data,
  });
}

// 山西查询中长期限价
export function editSxMediumAndLongData(data: any) {
  return request(`/configuration/officialGuidancePrice/edit`, {
    method: 'POST',
    data,
  });
}

// 山西查询中长期限价
export function downLoadSxMediumAndLong(data: any) {
  return exportRequest(
    `/configuration/officialGuidancePrice/downLoad/${data.year}/${data.quarter}/${data.marketId}`,
    {
      method: 'GET',
    },
  );
}

// 山西中长期导入
export const sxUploadUrl = '/configuration/officialGuidancePrice/uploadFile';
